<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>弹性--居中</title>
    <style>
        .big{
            width: 800px;
            height: 600px;
            border: 3px solid black;
            margin: 0 auto;
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center;
        }
        .small{
            width: 200px;
            height: 200px;
            border: 3px solid red;
        }
    </style>
</head>
<body>
    <div class="big">
        <div class="small"></div>
    </div>
</body>
</html>